package com.bw.day0703;

import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;
import org.apache.flink.table.api.Table;
import org.apache.flink.table.api.bridge.java.StreamTableEnvironment;

/**
 * @author y3068
 * @Classname Test1
 * @Description TODO
 * @Date 2025/7/3 10:07
 * @Version V1.0
 */

public class Test1 {

    public static void main(String[] args) {

        StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
        env.setParallelism(1);

        StreamTableEnvironment tEnv = StreamTableEnvironment.create(env);

        tEnv.executeSql("create table dwd_ub(" +
                "log_id string," +
                "user_id string," +
                "item_id string," +
                "behavior_type string," +
                "behavior_time string," +
                "search_keyword string," +
                "session_id string," +
                "stay_duration string," +
                "page_url string" +
                ")" + com.bw.utils.MyKafkaUtil.getKafkaDDL("user_behavior_topic", "a"));

//        tEnv.executeSql("select * from dwd_ub").print();

        tEnv.executeSql("create table dwd_ia(" +
                "item_id string," +
                "item_name string," +
                "category_id string," +
                "category_path string," +
                "keywords string," +
                "description string," +
                "price double," +
                "is_maternal string," +
                "create_time string" +
                ")" + com.bw.utils.MyKafkaUtil.getKafkaDDL("item_attributes_topic", "b"));

//        tEnv.executeSql("select * from dwd_ia").print();




    }
}
